<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/24
 * Time: 16:16
 */
//array_merge函数：合并一个或多个数组
$arr1 = array ('张三','李四','王五','朱六');
$arr2 = array ('张三','李四','王五','朱六');
print_r(array_merge($arr1,$arr2));
echo '<br />';

//array_push函数：将一个或多个单元压入数组的末尾
$arr1 = ['张三','李四','王五','朱六'];
array_push($arr1,'小丽');
print_r($arr1);
echo '<br />';

$arr3 = [
    'aa1'=>'雄安1',
    'aa2'=>'雄安2',
    'aa3'=>'雄安3',
    'aa4'=>'雄安4',
    ];
array_push($arr3,"aa5","雄安5");
print_r($arr3);
echo '<br />';

//count函数：计算数组中的单元数目或对象中的属性个数
$arr1 = ['张三','李四','王五','朱六'];
echo count($arr1);
echo '<br />';

//in_array函数：查找数组中是否存在某个值
$arr1 = ['张三','李四','王五','朱六'];
if(!in_array('小米',$arr1)){
    $arr1[]='小米';
}
print_r($arr1);

